<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
</head>
<body class="body">
	
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a class="brand" href="#">凯盛项目管理系统</a>
			</div>
		</div>
	</div>
	
	
	<div class="container">
	  <div class="row">
		<div class="span9">
			<form class="form-horizontal" id="form1" action="edit_goal.jspx" method="post">
		        <fieldset>
		          <legend>编辑目标</legend>
		          <div class="control-group">
		            <label class="control-label" id="input01" for="input01">目标名称</label>
		            <div class="controls">
		            	<input type="hidden" name="id" value="${requestScope.goal.id }"/>	
		              	<input type="text"  style="color:black" class="span5" name="name" id="inputname" value="${requestScope.goal.name }" x-webkit-speech="undefined">
		              	<p class="help-block">In addition to freeform text, any HTML5 text-based input appears like so.</p>
		            </div>
		          </div>
		          <div class="control-group">
		            <label class="control-label" for="input01">目标描述</label>
		            <div class="controls">
		              <textarea class="span5" id="inputdesc" name="desc" rows="8">${requestScope.goal.desc}</textarea>
		            </div>
		          </div>
		          
		          <div class="form-actions">
		            <input type="button" id="btn1" class="btn btn-primary" value="保存">
		          </div>
		        </fieldset>
		      </form>          
          	
		</div>
		<div class="span3">
			
		</div>
	  </div>
	</div>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$("#inputname").focus(function(){
				$(this).css("color","black");
				$(this).val("");
			
			});
			$("#inputname").focusout(function(){
				//var val = $(this).val();
				//var reg = /\w+/;
				//var result = reg.test(val);
				if(!$(this).val()){
					$(this).val("目标名称不能为空！");
					$(this).css("color","red");
				}
				
			});
			$("#btn1").click(function(){
			
				if($("#inputname").val() && $("#inputdesc").val()){
					$("#form1").submit();
				}
			
			});
		
		
		
		
		
		});
	
	
	
	</script>
</body>
</html>